package site

import (
	"context"
	"github.com/gogf/gf/v2/util/gconv"
	"hotgo/internal/service"

	"hotgo/api/site/v1"
)

func (c *ControllerV1) AccountLogin(ctx context.Context, req *v1.AccountLoginReq) (res *v1.AccountLoginRes, err error) {
	model, err := service.AdminSite().AccountLogin(ctx, &req.AccountLoginInp)
	if err != nil {
		return
	}

	err = gconv.Scan(model, &res)
	return
}
